package k2_oop.p8_javaUtil;

import java.util.Calendar;
import java.util.Date;

public class UseCalendar {
    public static void main(String[] args) {

        Calendar calendar = Calendar.getInstance();


//        System.out.println(calendar.get(Calendar.YEAR));
//        System.out.println(calendar.get(Calendar.MONTH)+1);
//        System.out.println(calendar.get(Calendar.DATE));
//        System.out.println(calendar.get(Calendar.HOUR));
//        System.out.println(calendar.get(Calendar.MINUTE));
//        System.out.println(calendar.get(Calendar.SECOND));
//        System.out.println(calendar.get(Calendar.MILLISECOND));
//        System.out.println(calendar.get(Calendar.DAY_OF_WEEK));
//        System.out.println(calendar.get(Calendar.DAY_OF_YEAR));
//        System.out.println(calendar.get(Calendar.DAY_OF_WEEK_IN_MONTH));
//        System.out.println(calendar.get(Calendar.WEEK_OF_MONTH));
//        System.out.println(calendar.get(Calendar.WEEK_OF_YEAR));

//        calendar.set(Calendar.YEAR,2060);

        calendar.setLenient(false);
        calendar.set(2028,8,10);

//        calendar.roll(Calendar.MONTH,15);
        System.out.println(calendar.get(Calendar.YEAR));
        System.out.println(calendar.get(Calendar.MONTH)+1);


        Date date = calendar.getTime();
        System.out.println(date);

        Date date1 = new Date();
        calendar.setTime(date1);
        System.out.println(calendar);

    }

}
